import java.util.LinkedList;
import java.util.List;
import java.util.Queue;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LianBao
 * Date: 2024-04-04
 * Time: 12:59
 */
public class Test {

    public static void main(String[] args) {
        BinaryTree tree = new BinaryTree();
        BinaryTree.TreeNode root = tree.createTree();
        System.out.print("前序遍历: ");
        tree.preOrder(root);
        System.out.println("");
        System.out.print("中序遍历: ");
        tree.inOrder(root);
        System.out.println("");
        System.out.print("后序遍历: ");
        tree.postOrder(root);
        System.out.println();
        System.out.println("结点个数");
        System.out.println(tree.size2(root));
        System.out.println("结点个数");
        tree.size(root);
        System.out.println(BinaryTree.nodeSize);
        System.out.println("叶子结点个数");
        System.out.println(tree.getLeafNodeCount2(root));
        System.out.println("叶子结点个数");
        tree.getLeafNodeCount1(root);
        System.out.println(BinaryTree.leafSize);
        System.out.println("第k层结点个数");
        System.out.println(tree.getKLevelNodeCount(root, 3));
        System.out.println("树的高度");
        System.out.println(tree.getHeight(root));
        System.out.println("val是否存在");
        System.out.println(tree.find(root, 'A').val);
        System.out.println("===============");
        List<Character> ret = tree.levelOrder(root);
        System.out.println("层序遍历");
        System.out.println(ret);
    }

    public static void main2(String[] args) {
        Queue<Integer> queue = new LinkedList<>();
        queue.offer(1);
    }

    public static void main1(String[] args) {
        MyQueue<Integer> queue = new MyQueue<>();
        System.out.println(queue.empty());
        queue.offer(1);
        queue.offer(2);
        queue.offer(3);
        queue.offer(4);
        queue.offer(5);
        Integer ret = queue.peek();
        System.out.println(ret);

    }
}
